<div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">密码修改</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Basic Form Elements
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-8">
                                    <form method="post" role="form" action="<?=site_url('users/do_change')?>" id="myform">
                                        <div class="form-group">
                                            <label>用户名：</label>
                                            <input class="form-control" type="text" readonly value="<?=$name?>">
                                        </div>
                                        <div class="form-group">
                                            <label>原始密码：</label>
                                            <input class="form-control" type="password" name="password">
                                            <p class="help-block">请准确填写原始密码</p>
                                        </div>
                                        <div class="form-group">
                                            <label>新密码：</label>
                                            <input class="form-control" type="password" name="password1">
                                            <p class="help-block">请准确填写新密码</p>
                                        </div>
                                        <div class="form-group">
                                            <label>确认密码：</label>
                                            <input class="form-control" type="password" name="password2">
                                            <p class="help-block">请准确填写确认密码</p>
                                        </div>
                                        <button type="submit" class="btn btn-primary">修改</button>
                                       <!--  <button type="reset" class="btn btn-default">重置</button> -->
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>

<script type="text/javascript">
    $('#myform').submit(function() {
        var index = layer.load(2);
        $(this).ajaxSubmit(function(data){
            layer.close(index);
            if(data == 1){
                layer.alert("操作成功！",{
                    icon:1,
                },function(){
                    location.href='<?=site_url("home")?>';
                });
            }else{
                layer.alert(data,{
                    icon:2,
                });
            }
        })
        return false;
    })

</script>